<%--
  Created by IntelliJ IDEA.
  User: IFT8
  Date: 2015/2/20
  Time: 18:20
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title></title>
</head>
<body>
<%
    /*  4大域
        ServletContext(application域) > Session(session域)
         > request(request域) >pageContext(pageContext) */
    application.setAttribute("name", "servletContext");//ServletContext
    session.setAttribute("name", "session");//Session
    request.setAttribute("name", "request");//request
    pageContext.setAttribute("name", "pageContext", PageContext.PAGE_SCOPE);//PageContext
%>
    <%=application.getAttribute("name")%> <br>
    <%=session.getAttribute("name")%> <br>
    <%=request.getAttribute("name")%> <br>
    <%=pageContext.getAttribute("name")%> <br>
<!- 从最小的域开始向最大的域开始搜索，找到则返回值，找完四大域都找不到值则返回null ->
    <%=pageContext.findAttribute("name")%>
</body>
</html>
